package com.lagou.edu;

import com.edu.result.ResponseDTO;
import com.lagou.edu.dto.PromotionSpaceDTO;
import com.lagou.edu.remoteservice.AdRemoteService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author wpp25
 * @date 2021/8/4 22:51
 * @description：
 */
@RestController
@RequestMapping("/ad/front")
public class AdController {

    @Resource
    private AdRemoteService adRemoteService;

    @RequestMapping("/space/getAdBySpaceKey")
    public ResponseDTO getAdBySpaceKey(@RequestParam("spaceKey") String[] spaceKey) throws Exception{
        List<PromotionSpaceDTO> dtoList = adRemoteService.getAdBySpaceKey(spaceKey);
        return ResponseDTO.success(dtoList);
    }
}
